Highcharts.setOptions({
    lang: {
        rangeSelectorZoom: '',
        rangeSelectorFrom: '寮€濮嬫椂闂�',
        rangeSelectorTo: '缁撴潫鏃堕棿'
    },
    global: {
        timezoneOffset: -8 * 60
    }
});

var space = '&nbsp;&nbsp;&nbsp;&nbsp;';

//涓偂鍒嗘椂鍥�
function drawChart(el, jsonData, code) {

    //鏁版嵁
    var timeLineData = jsonData.data;
    //鏁版嵁闀垮害
    var length = timeLineData.length;
    //鏈€鍚庢暟鎹�
    var last_data = jsonData.data[length - 1];
    //寮€鐩樹环
    var todayOpen = Number(jsonData.open);
    //鏄ㄦ敹(濡傛灉鏄ㄦ敹涓�0锛屼粖寮€涓嶄负0锛屾槰鏀剁敤浠婂紑鏉ヨ绠�)
    var yesterdayClose = jsonData.yes == 0 && jsonData.open != 0 ? Number(jsonData.open) : Number(jsonData.yes);
    var todayDate = timeLineData[0][0];

    var caldatas = [];
    var positions = [];

    var day = Highcharts.dateFormat('%Y/%m/%d', todayDate),
        breaks = [{
            from: new Date(day + ' 11:30').getTime(),
            to: new Date(day + ' 13:00').getTime(),
            breakSize: 0 * 60 * 1000
        }],
        min = new Date(day + ' 9:30').getTime(),
        max = new Date(day + ' 15:00').getTime(),
        // x 杞存爣绛句究瀹滈珮搴�
        height = $('#' + el).height() * 0.23,
        width = $('#' + el).width();

    if (jsonData.yes == 0 && last_data[2] == 0) {
        var ymin = -2.0;
        var ymax = 2.0;
        var startOnTick = false;
        var endOnTick = false;
    } else {
        var ymin = null;
        var ymax = null;
        var startOnTick = true;
        var endOnTick = true;
    }

    caldatas = cal_data(timeLineData, yesterdayClose);
    show_info(timeLineData, yesterdayClose, jsonData.open, 'si_fs_infos', 1);
    //鎻愮ず妗嗗嚭鐜�
    $('#si_fs_infos').show();

    // Create the chart
    $('#' + el).highcharts('StockChart', {
        chart: {
            spacing: 1,
            borderRadius: 0,
            animation: false,
            events: {
                load: function() {

                    //鑾峰彇褰撳ぉ鏃ユ湡
                    var myDate = new Date();
                    var day = myDate.getDay();
                    var hour = myDate.getHours();
                    var minute = myDate.getMinutes();
                    var time = hour + ':' + minute;

                    //鍛ㄤ竴鍒板懆浜旀墽琛屽畾鏃跺埛鏂�
                    if (myDate.getDay() > 0 && myDate.getDay() < 6) {
                        if (time_range("09:30", "11:30") || time_range("13:00", "15:00")) {
                            //瀹氭椂鑾峰彇瀹炴椂鏁版嵁
                            setInterval(function() {
                                yesterdayClose = Number(jsonData.yes);
                                todayOpen = Number(jsonData.open);
                                //鍦板潃
                                var url = '/investor/getAjax/?hqzqdm=' + code;
                                $.getJSON(url, function(jsonData) {
                                    var chart = $('#' + el).highcharts();

                                    timeLineData = jsonData.data;

                                    //浠锋牸
                                    var cur_price = jsonData.f3;

                                    //閲嶆柊璁＄畻
                                    caldatas = cal_data(timeLineData, yesterdayClose);
                                    //鏇存柊鍥捐〃
                                    chart.series[0].update({
                                        data: timeLineData
                                    }, false);
                                    chart.series[1].update({
                                        data: timeLineData
                                    }, false);
                                    chart.series[2].update({
                                        data: caldatas[4]
                                    }, false);

                                    chart.redraw();
                                    var DateString = myDate.toLocaleDateString()
                                    var time = DateString.replace(/\//g, '-');
                                    if (hour < parseInt(15)) {
                                        var newtime = jsonData.date
                                    } else {
                                        var newtime = time + " 15:00:00";
                                    }

                                    //鏇存柊鍩烘湰淇℃伅
                                    var pnum_html = '';
                                    var curpri_html = '';
                                    if (cur_price > jsonData.yes) { //娑�
                                        pnum_html = "<div class='numbers'><span class='price'><span class='red_font'>楼" + jsonData.f3_float + "</span></span>";
                                        pnum_html += "<span class='updown'><span class='red_font'>+" + jsonData.zz + "(" + jsonData.updown + "%)</span></span></div>";
                                        pnum_html += "<div class='date'>" + newtime + "</div>";
                                        curpri_html = "<span class='red_font'>" + jsonData.f3_float + "</span>";
                                    } else if (cur_price < jsonData.yes) { //璺�
                                        pnum_html = "<div class='numbers'><span class='price'><span class='green_font'>楼" + jsonData.f3_float + "</span></span>";
                                        pnum_html += "<span class='updown'><span class='green_font'>" + jsonData.zz + "(" + jsonData.updown + "%)</span></span></div>";
                                        pnum_html += "<div class='date'>" + newtime + "</div>";
                                        curpri_html = "<span class='green_font'>" + jsonData.f3_float + "</span>";
                                    } else { //鐩哥瓑
                                        pnum_html = "<div class='numbers'><span class='price'><span class='green_font'>楼" + jsonData.f3_float + "</span></span>";
                                        pnum_html += "<span class='updown'><span class='green_font'>" + jsonData.zz + "(" + jsonData.updown + "%)</span></span></div>";
                                        pnum_html += "<div class='date'>" + newtime + "</div>";
                                        curpri_html = "<span class='green_font'>" + jsonData.f3_float + "</span>";
                                    }
                                    $('.pnum').html(pnum_html);

                                    //娑ㄨ穼锛屾定璺屽箙,鏈€楂樻渶浣�
                                    $('.pdata table').find('tr').eq(1).find('td').eq(0).html('娑ㄨ穼锛�' + jsonData.zz);
                                    $('.pdata table').find('tr').eq(1).find('td').eq(1).html('娑ㄨ穼骞�(%)锛�' + jsonData.updown);
                                    $('.pdata table').find('tr').eq(1).find('td').eq(2).html('鏈€楂橈細' + jsonData.f7);
                                    $('.pdata table').find('tr').eq(1).find('td').eq(3).html('鏈€浣庯細' + jsonData.f8);

                                    //鎴愪氦閲忥紝鎴愪氦棰濓紝鎴愪氦绗旀暟锛屾尟骞�
                                    $('.pdata table').find('tr').eq(2).find('td').eq(0).html('鎴愪氦閲忥細' + jsonData.f4 / 10000 + '涓�');
                                    $('.pdata table').find('tr').eq(2).find('td').eq(1).html('鎴愪氦棰�(涓囧厓)锛�' + jsonData.f5);
                                    $('.pdata table').find('tr').eq(2).find('td').eq(2).html('鎴愪氦绗旀暟锛�' + jsonData.f6);
                                    $('.pdata table').find('tr').eq(2).find('td').eq(3).html('鎸箙(%)锛�' + jsonData.zhenfu);

                                    //涔板崠浠�
                                    var t1_html = "<table><tbody><tr><td>鍗�5</td><td>" + jsonData.f14 + "</td><td>" + jsonData.f15 + "</td></tr>";
                                    t1_html += "<tr><td>鍗�4</td><td>" + jsonData.f16 + "</td><td>" + jsonData.f17 + "</td></tr>";
                                    t1_html += "<tr><td>鍗�3</td><td>" + jsonData.f18 + "</td><td>" + jsonData.f19 + "</td></tr>";
                                    t1_html += "<tr><td>鍗�2</td><td>" + jsonData.f20 + "</td><td>" + jsonData.f21 + "</td></tr>";
                                    t1_html += "<tr><td>鍗�1</td><td>" + jsonData.f22 + "</td><td>" + jsonData.f23 + "</td></tr></tbody></table>";

                                    var t2_html = "<table><tbody><tr><td>涔�1</td><td>" + jsonData.f24 + "</td><td>" + jsonData.f25 + "</td></tr>";
                                    t2_html += "<tr><td>涔�2</td><td>" + jsonData.f26 + "</td><td>" + jsonData.f27 + "</td></tr>";
                                    t2_html += "<tr><td>涔�3</td><td>" + jsonData.f28 + "</td><td>" + jsonData.f29 + "</td></tr>";
                                    t2_html += "<tr><td>涔�4</td><td>" + jsonData.f30 + "</td><td>" + jsonData.f31 + "</td></tr>";
                                    t2_html += "<tr><td>涔�5</td><td>" + jsonData.f32 + "</td><td>" + jsonData.f33 + "</td></tr></tbody></table>";

                                    $('.details_right .right_data').eq(0).html(t1_html);
                                    $('.details_right .right_data').eq(1).html(t2_html);
                                    $('.details_right .current_price').find('td').eq(2).html(curpri_html);

                                    //fs_infos
                                    var fs_infos_open = '浠婂紑:' + todayOpen + space;
                                    var fs_infos_cur = '褰撳墠:' + jsonData.f3_float;
                                    fs_infos_cur += jsonData.zz > 0 ? "<span class='red_font'>(" + jsonData.updown + "%)</span>" : "<span class='green_font'>(" + jsonData.updown + "%)</span>";
                                    var fs_infos_time = '鏃堕棿:' + Highcharts.dateFormat('%H:%M', jsonData.f0);
                                    var fs_infos = fs_infos_open + fs_infos_cur + space + fs_infos_time;
                                    $('#si_fs_infos').html(fs_infos);

                                });
                            }, 60 * 1000);
                        } else {
                            return false;
                        }
                    } else {
                        return false;
                    }

                }
            }
        },
        colors: ['#2f7ed8', '#2E84CC', '#8bbc21', '#910000', '#1aadce',
            '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'
        ],
        rangeSelector: {
            enabled: false
        },
        scrollbar: {
            enabled: false,
        },
        navigator: {
            enabled: false
        },

        title: {
            text: ''
        },
        credits: {
            // enabled: false.
            text: 'Chinaipo.com',
            href: 'http://www.chinaipo.com',
            position: {
                align: 'left',
                x: 350,
                y: -height - 26,
                style: {
                    cursor: 'pointer',
                    fontSize: '12px'
                }
            }
        },
        xAxis: [{
            min: min,
            max: max,
            gridLineWidth: 1,
            tickLength: 0,
            labels: {
                y: -height - 5,
                autoRotation: false,
                autoRotationLimit: 0,
                formatter: function() {
                    if (this.value === new Date(day + ' 11:30').getTime()) {
                        return '11:30/13:00';
                    }
                    return Highcharts.dateFormat('%H:%M', this.value);
                }
            },
            breaks: breaks,
            tickPositioner: function() {
                return [new Date(day + ' 09:30').getTime(), new Date(day + ' 10:30').getTime(), new Date(day + ' 11:30').getTime(), new Date(day + ' 14:00').getTime(), new Date(day + ' 15:00').getTime()]
            },
        }],
        yAxis: [{
                max: ymax,
                min: ymin,
                startOnTick: startOnTick,
                endOnTick: endOnTick,
                height: '70%',
                lineColor: '#C7CBD4',
                opposite: false,
                lineWidth: 1,
                labels: {
                    x: 10,
                    align: 'left',
                    formatter: function() {
                        if (yesterdayClose == 0) {
                            if (this.value == 0) {
                                return '0.00';
                            } else {
                                return false;
                            }
                        } else {
                            if (this.value.toFixed(2) == yesterdayClose) {
                                return this.value.toFixed(2);
                            } else if (this.value > yesterdayClose) {
                                return '<span style="color:#D71720">' + this.value.toFixed(2) + '</span>';
                            } else {
                                return '<span style="color:#00a650">' + this.value.toFixed(2) + '</span>';
                            }
                        }
                    }
                },
                showFirstLabel: true,
                showLastLabel: true,
                tickPositioner: function() {
                    positions = cal_positions(timeLineData, yesterdayClose, caldatas);
                    if (jsonData.yes == 0) {
                        positions = [2.00, 1.00, 0.00, -1.00, -2.00];
                    }
                    return positions;
                },
                plotLines: [{
                    value: yesterdayClose,
                    width: 2,
                    color: '#D71720',
                    dashStyle: 'shortDot',
                    label: {
                        y: 14
                    }
                }],
            },
            {
                max: ymax,
                min: ymin,
                startOnTick: startOnTick,
                endOnTick: endOnTick,
                height: '70%',
                opposite: true,
                showFirstLabel: true,
                showLastLabel: true,
                gridLineWidth: 1,
                labels: {
                    x: -10,
                    align: 'right',
                    formatter: function() {
                        if (yesterdayClose == 0) {
                            if (this.value == 0) {
                                return '0.00%'
                            } else {
                                return false;
                            }
                        } else {
                            var percent = (this.value - yesterdayClose) / yesterdayClose * 100,
                                flag = percent > 0 ? '+' : '';
                            if (percent.toFixed(2) == 0) {
                                return percent.toFixed(2) + '%';
                            } else if (this.value > yesterdayClose) {
                                return '<span style="color:#D71720">' + flag + percent.toFixed(2) + '%</span>';
                            } else {
                                return '<span style="color:#00a650">' + flag + percent.toFixed(2) + '%</span>';
                            }
                        }
                    }
                },
                showFirstLabel: false,
                tickPositioner: function() {
                    return positions;
                }

            },
            {
                top: '77%',
                height: '23%',
                showFirstLabel: false,

                labels: {
                    x: -10,
                    align: 'right',
                    formatter: function() {
                        return (this.value / 10000).toFixed(2) + '涓�';
                    }
                }
            }
        ],
        plotOptions: {
            series: {
                dataGrouping: {
                    enabled: false
                },
                pointPlacement: 'on'
            }
        },

        tooltip: {
            shared: true,
            useHTML: true,
            shadow: false,
            borderColor: "rgba(255, 255, 255, 0)",
            backgroundColor: "rgba(255, 255, 255, 0)",
            formatter: function() {
                yesterdayClose = Number(jsonData.yes);
                todayOpen = Number(jsonData.open);
                var points = this.points,
                    percent = 0,
                    str = '浠婂紑:' + todayOpen.toFixed(2) + space,
                    time = '鏃堕棿:' + Highcharts.dateFormat('%H:%M', this.points[0].x);

                // console.log(points);
                // str                
                Highcharts.each(points,
                    function(p, i) {
                        if (i === 0) {
                            str += '褰撳墠:' + p.y.toFixed(2);
                        } else if (i === 1) {
                            if (yesterdayClose == 0) {
                                str += "(0.00%)" + space;
                            } else {
                                percent = (p.y - yesterdayClose) / yesterdayClose * 100;
                                str += '<span style="color: ' + (percent > 0 ? '#D71720' : '#00a650') + '">(' + percent.toFixed(2) + '%)</span>' + space;
                            }
                        }
                        // else if (i === 2) {
                        //     str += '鎴愪氦閲�(涓�):' + (p.y / 10000).toFixed(2) + space
                        // }
                    });

                str += time;

                $('#si_fs_infos').html(str);

            }
        },

        series: [{
                name: '寮€鐩樹环',
                data: timeLineData,
                tooltip: {
                    valueDecimals: 2
                },
                // color: Highcharts.getOptions().colors[1],
                lineWidth: 0,
                states: {
                    hover: {
                        lineWidthPlus: 0,
                        lineWidth: 1
                    }
                }
            },
            {
                name: '娑ㄥ箙',
                data: timeLineData,
                yAxis: 1,
                zIndex: 10,
                lineWidth: 1,
                states: {
                    hover: {
                        lineWidthPlus: 0,
                        lineWidth: 1
                    }
                }

            },
            {
                name: '鎴愪氦閲�',
                data: caldatas[4],
                yAxis: 2,
                type: 'column'
            }
        ]
    });

}

//涓偂鍙充晶涓夋澘鎴愭寚锛屼笁鏉垮仛甯�
function drawRightChart(el, jsonData) {

    //鏁版嵁
    var timeLineData = jsonData.data;
    //鏁版嵁闀垮害
    var length = timeLineData.length;
    //鏈€鍚庢暟鎹�
    var last_data = jsonData.data[length - 1];
    //寮€鐩樹环
    var todayOpen = Number(jsonData.open);
    //鏄ㄦ敹
    var yesterdayClose = Number(jsonData.yes);
    var todayDate = timeLineData[0][0];

    var caldatas = [];
    var positions = [];

    var day = Highcharts.dateFormat('%Y/%m/%d', todayDate),
        breaks = [{
            from: new Date(day + ' 11:30').getTime(),
            to: new Date(day + ' 13:00').getTime(),
            breakSize: 0 * 60 * 1000
        }],
        min = new Date(day + ' 9:30').getTime(),
        max = new Date(day + ' 15:00').getTime(),
        // x 杞存爣绛句究瀹滈珮搴�
        height = 0,
        width = $('#' + el).width();

    caldatas = cal_data(timeLineData, yesterdayClose);
    show_info(timeLineData, yesterdayClose, jsonData.open, 'sr_fs_infos', 2);

    //鎻愮ず妗嗗嚭鐜�
    $('#sr_fs_infos').show();

    // Create the chart
    $('#' + el).highcharts('StockChart', {
        chart: {
            spacing: 1,
            animation: false,
            border: 1,
            borderColor: '#C7CBD4',
            borderRadius: 0,
            events: {
                load: function() {

                    //鑾峰彇褰撳ぉ鏃ユ湡
                    var myDate = new Date();
                    var day = myDate.getDay();
                    var hour = myDate.getHours();
                    var minute = myDate.getMinutes();
                    var time = hour + ':' + minute;

                    //鍛ㄤ竴鍒板懆浜旀墽琛屽畾鏃跺埛鏂�
                    if (myDate.getDay() > 0 && myDate.getDay() < 6) {
                        if (time_range("09:30", "11:30") || time_range("13:00", "15:00")) {
                            //瀹氭椂鑾峰彇瀹炴椂鏁版嵁
                            setInterval(function() {
                                yesterdayClose = Number(jsonData.yes);
                                todayOpen = Number(jsonData.open);
                                //鍦板潃
                                var url = '/investor/getAjax/?hqzqdm=899002';
                                $.getJSON(url, function(jsonData) {
                                    var chart = $('#' + el).highcharts();

                                    timeLineData = jsonData.data;

                                    //浠锋牸
                                    var cur_price = jsonData.f3;

                                    //閲嶆柊璁＄畻
                                    caldatas = cal_data(timeLineData, yesterdayClose);
                                    //鏇存柊鍥捐〃
                                    chart.series[0].update({
                                        data: timeLineData
                                    }, false);
                                    chart.series[1].update({
                                        data: timeLineData
                                    }, false);

                                    chart.redraw();

                                    //fs_infos
                                    var fs_infos_cur = '褰撳墠:' + jsonData.f3_float;
                                    fs_infos_cur += jsonData.zz > 0 ? "<span class='red_font'>(" + jsonData.updown + "%)</span>" : "<span class='green_font'>(" + jsonData.updown + "%)</span>";
                                    var fs_infos_time = '鏃堕棿:' + Highcharts.dateFormat('%H:%M', jsonData.f0);
                                    var fs_infos = fs_infos_cur + space + fs_infos_time;
                                    $('#sr_fs_infos').html(fs_infos);
                                });
                            }, 60 * 1000);
                        } else {
                            return false;
                        }
                    } else {
                        return false;
                    }

                }
            }
        },
        colors: ['#2f7ed8', '#2E84CC', '#8bbc21', '#910000', '#1aadce',
            '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'
        ],
        rangeSelector: {
            enabled: false
        },
        scrollbar: {
            enabled: false,
        },
        navigator: {
            enabled: false
        },

        title: {
            text: ''
        },
        credits: {
            // enabled: false.
            text: 'Chinaipo.com',
            href: 'http://www.chinaipo.com',
            position: {
                align: 'left',
                x: 212,
                y: -26,
                style: {
                    cursor: 'pointer',
                    fontSize: '12px'
                }
            }
        },
        xAxis: [{
            min: min,
            max: max,
            lineWidth: 0,
            gridLineWidth: 1,
            tickLength: 0,
            labels: {
                y: -height,
                autoRotation: false,
                autoRotationLimit: 120,
                formatter: function() {
                    if (this.value === new Date(day + ' 11:30').getTime()) {
                        return '13:30';
                    }
                    return Highcharts.dateFormat('%H:%M', this.value);
                }
            },
            breaks: breaks,
            tickPositioner: function() {
                return [new Date(day + ' 09:30').getTime(), new Date(day + ' 10:30').getTime(), new Date(day + ' 11:30').getTime(), new Date(day + ' 14:00').getTime(), new Date(day + ' 15:00').getTime()]
            },
        }],
        yAxis: [{
            height: '93%',
            lineColor: '#C7CBD4',
            opposite: false,
            lineWidth: 1,
            labels: {

                x: 10,
                align: 'left',
                formatter: function() {
                    if (this.value.toFixed(2) == yesterdayClose) {
                        return this.value.toFixed(2);
                    } else if (this.value > yesterdayClose) {
                        return '<span style="color:#D71720">' + this.value.toFixed(2) + '</span>';
                    } else {
                        return '<span style="color:#00a650">' + this.value.toFixed(2) + '</span>';
                    }
                }
            },
            showFirstLabel: true,
            showLastLabel: true,
            tickPositioner: function() {
                positions = cal_positions(timeLineData, yesterdayClose, caldatas);
                return positions;
            },
            plotLines: [{
                value: yesterdayClose,
                width: 2,
                color: '#D71720',
                dashStyle: 'shortDot',
                label: {
                    y: 14
                }
            }],
        }, {
            height: '93%',
            opposite: true,
            showFirstLabel: true,
            showLastLabel: true,
            gridLineWidth: 1,
            labels: {
                x: -10,
                align: 'right',
                formatter: function() {
                    var percent = (this.value - yesterdayClose) / yesterdayClose * 100,
                        flag = percent > 0 ? '+' : '';

                    if (percent.toFixed(2) == 0) {
                        return percent.toFixed(2) + '%';
                    } else if (this.value > yesterdayClose) {
                        return '<span style="color:#D71720">' + flag + percent.toFixed(2) + '%</span>';
                    } else {
                        return '<span style="color:#00a650">' + flag + percent.toFixed(2) + '%</span>';
                    }
                }
            },
            showFirstLabel: false,
            tickPositioner: function() {
                return positions;
            }
        }],
        plotOptions: {
            series: {
                dataGrouping: {
                    enabled: false
                },
                pointPlacement: 'on'
            }
        },

        tooltip: {
            shared: true,
            useHTML: true,
            shadow: false,
            borderColor: "rgba(255, 255, 255, 0)",
            backgroundColor: "rgba(255, 255, 255, 0)",
            formatter: function() {
                yesterdayClose = Number(jsonData.yes);
                todayOpen = Number(jsonData.open);
                var points = this.points,
                    percent = 0,
                    str = '',
                    time = '鏃堕棿:' + Highcharts.dateFormat('%H:%M', this.points[0].x);
                Highcharts.each(points,
                    function(p, i) {
                        if (i === 0) {
                            str += '褰撳墠:' + p.y.toFixed(2);
                        }
                        if (i === 1) {
                            percent = (p.y - yesterdayClose) / yesterdayClose * 100;
                            str += '<span style="color: ' + (percent > 0 ? '#D71720' : '#00a650') + '">(' + percent.toFixed(2) + '%)</span>' + space;
                        }
                    });

                str += time;

                $('#sr_fs_infos').html(str);
            }
        },

        series: [{
                name: '寮€鐩樹环',
                data: timeLineData,
                tooltip: {
                    valueDecimals: 2
                },
                // color: Highcharts.getOptions().colors[1],
                lineWidth: 0,
                states: {
                    hover: {
                        lineWidthPlus: 0,
                        lineWidth: 1
                    }
                }
            },
            {
                name: '娑ㄥ箙',
                data: timeLineData,
                yAxis: 1,
                zIndex: 10,
                lineWidth: 1,
                states: {
                    hover: {
                        lineWidthPlus: 0,
                        lineWidth: 1
                    }
                }

            }
        ]
    });
}

//棣栭〉鍋氬競鍒嗘椂鍥�
function drawIndexChart(el, jsonData, code) {

    //鏁版嵁
    var timeLineData = jsonData.data;
    //鏁版嵁闀垮害
    var length = timeLineData.length;
    //鏈€鍚庢暟鎹�
    var last_data = jsonData.data[length - 1];
    //寮€鐩樹环
    var todayOpen = Number(jsonData.open);
    //鏄ㄦ敹
    var yesterdayClose = Number(jsonData.yes);
    var todayDate = timeLineData[0][0];

    var caldatas = [];
    var positions = [];

    var day = Highcharts.dateFormat('%Y/%m/%d', todayDate),
        breaks = [{
            from: new Date(day + ' 11:30').getTime(),
            to: new Date(day + ' 13:00').getTime(),
            breakSize: 0 * 60 * 1000
        }],
        min = new Date(day + ' 9:30').getTime(),
        max = new Date(day + ' 15:00').getTime(),
        // x 杞存爣绛句究瀹滈珮搴�
        height = $('#' + el).height() * 0.23,
        width = $('#' + el).width();

    caldatas = cal_data(timeLineData, yesterdayClose);
    show_info(timeLineData, yesterdayClose, jsonData.open, 'in_fs_infos', 1);

    //鎻愮ず妗嗗嚭鐜�
    $('#in_fs_infos').show();

    // Create the chart
    $('#' + el).highcharts('StockChart', {
        chart: {
            spacing: 1,
            borderRadius: 0,
            animation: false,
            events: {
                load: function() {
                    //鑾峰彇褰撳ぉ鏃ユ湡
                    var myDate = new Date();
                    var day = myDate.getDay();
                    var hour = myDate.getHours();
                    var minute = myDate.getMinutes();
                    var time = hour + ':' + minute;

                    //鍛ㄤ竴鍒板懆浜旀墽琛屽畾鏃跺埛鏂�
                    if (myDate.getDay() > 0 && myDate.getDay() < 6) {
                        if (time_range("09:30", "11:30") || time_range("13:00", "15:00")) {
                            //瀹氭椂鑾峰彇瀹炴椂鏁版嵁
                            setInterval(function() {
                                yesterdayClose = Number(jsonData.yes);
                                todayOpen = Number(jsonData.open);
                                //鍦板潃
                                var url = '/investor/AjaxGuPiao/app=price&mod=Data&act=getK&hqzqdm=' + code;
                                $.getJSON(url, function(jsonData) {
                                    var chart = $('#' + el).highcharts();

                                    timeLineData = jsonData.data;

                                    //浠锋牸
                                    var cur_price = jsonData.f3;

                                    //閲嶆柊璁＄畻
                                    caldatas = cal_data(timeLineData, yesterdayClose);
                                    //鏇存柊鍥捐〃
                                    chart.series[0].update({
                                        data: timeLineData
                                    }, false);
                                    chart.series[1].update({
                                        data: timeLineData
                                    }, false);
                                    chart.series[2].update({
                                        data: caldatas[4]
                                    }, false);

                                    chart.redraw();


                                    //鏇存柊
                                    if (jsonData.yes < cur_price) { //娑�
                                        pnum_html = "<span class='red_font'>" + jsonData.f3_float + "</span>";
                                        pnum_html += "<span class='red_font'>+" + jsonData.zz + "(" + jsonData.updown + "%)</span>";
                                        pnum_html += "<span>" + jsonData.date + "</span>";
                                    } else if (jsonData.yes > cur_price) { //璺�
                                        pnum_html = "<span class='green_font'>" + jsonData.f3_float + "</span>";
                                        pnum_html += "<span class='green_font'>" + jsonData.zz + "(" + jsonData.updown + "%)</span>";
                                        pnum_html += "<span>" + jsonData.date + "</span>";
                                    } else { //鐩哥瓑
                                        pnum_html = "<span class='green_font'>" + jsonData.f3_float + "</span>";
                                        pnum_html += "<span class='green_font'>+" + jsonData.zz + "(" + jsonData.updown + "%)</span>";
                                        pnum_html += "<span>" + jsonData.date + "</span>";
                                    }
                                    $('.up_info').html(pnum_html);

                                    //fs_infos
                                    var fs_infos_open = '浠婂紑:' + todayOpen + space;
                                    var fs_infos_cur = '褰撳墠:' + jsonData.f3_float;
                                    fs_infos_cur += jsonData.zz > 0 ? "<span class='red_font'>(" + jsonData.updown + "%)</span>" : "<span class='green_font'>(" + jsonData.updown + "%)</span>";
                                    var fs_infos_time = '鏃堕棿:' + Highcharts.dateFormat('%H:%M', jsonData.f0);
                                    var fs_infos = fs_infos_open + fs_infos_cur + space + fs_infos_time;
                                    $('#in_fs_infos').html(fs_infos);
                                });
                            }, 60 * 1000);
                        } else {
                            return false;
                        }
                    } else {
                        return false;
                    }

                }
            }
        },
        colors: ['#2f7ed8', '#2E84CC', '#8bbc21', '#910000', '#1aadce',
            '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'
        ],
        rangeSelector: {
            enabled: false
        },
        scrollbar: {
            enabled: false,
        },
        navigator: {
            enabled: false
        },

        title: {
            text: ''
        },
        credits: {
            // enabled: false.
            text: 'Chinaipo.com',
            href: 'http://www.chinaipo.com',
            position: {
                align: 'left',
                x: 350,
                y: -height - 26,
                style: {
                    cursor: 'pointer',
                    fontSize: '12px'
                }
            }
        },
        xAxis: [{
            min: min,
            max: max,
            gridLineWidth: 1,
            tickLength: 0,
            labels: {
                y: -height - 5,
                autoRotation: false,
                autoRotationLimit: 0,
                formatter: function() {
                    if (this.value === new Date(day + ' 11:30').getTime()) {
                        return '11:30/13:00';
                    }
                    return Highcharts.dateFormat('%H:%M', this.value);
                }
            },
            breaks: breaks,
            tickPositioner: function() {
                return [new Date(day + ' 09:30').getTime(), new Date(day + ' 10:30').getTime(), new Date(day + ' 11:30').getTime(), new Date(day + ' 14:00').getTime(), new Date(day + ' 15:00').getTime()]
            },
        }],
        yAxis: [{
                height: '70%',
                lineColor: '#C7CBD4',
                opposite: false,
                lineWidth: 1,
                labels: {
                    x: 10,
                    align: 'left',
                    formatter: function() {
                        if (this.value.toFixed(2) == yesterdayClose) {
                            return this.value.toFixed(2);
                        } else if (this.value > yesterdayClose) {
                            return '<span style="color:#D71720">' + this.value.toFixed(2) + '</span>';
                        } else {
                            return '<span style="color:#00a650">' + this.value.toFixed(2) + '</span>';
                        }
                    }
                },
                showFirstLabel: true,
                showLastLabel: true,
                tickPositioner: function() {
                    positions = cal_positions(timeLineData, yesterdayClose, caldatas);
                    return positions;
                },
                plotLines: [{
                    value: yesterdayClose,
                    width: 2,
                    color: '#D71720',
                    dashStyle: 'shortDot',
                    label: {
                        y: 14
                    }
                }],
            },
            {
                height: '70%',
                opposite: true,
                showFirstLabel: true,
                showLastLabel: true,
                gridLineWidth: 1,
                labels: {
                    x: -10,
                    align: 'right',
                    formatter: function() {
                        var percent = (this.value - yesterdayClose) / yesterdayClose * 100,
                            flag = percent > 0 ? '+' : '';

                        if (percent.toFixed(2) == 0) {
                            return percent.toFixed(2) + '%';
                        } else if (this.value > yesterdayClose) {
                            return '<span style="color:#D71720">' + flag + percent.toFixed(2) + '%</span>';
                        } else {
                            return '<span style="color:#00a650">' + flag + percent.toFixed(2) + '%</span>';
                        }
                    }
                },
                showFirstLabel: false,
                tickPositioner: function() {
                    return positions;
                }

            },
            {
                top: '77%',
                height: '23%',
                showFirstLabel: false,

                labels: {
                    x: -10,
                    align: 'right',
                    formatter: function() {
                        return (this.value / 10000).toFixed(2) + '涓�';
                    }
                },

            }
        ],
        plotOptions: {
            series: {
                dataGrouping: {
                    enabled: false
                },
                pointPlacement: 'on'
            }
        },

        tooltip: {
            shared: true,
            useHTML: true,
            shadow: false,
            borderColor: "rgba(255, 255, 255, 0)",
            backgroundColor: "rgba(255, 255, 255, 0)",
            formatter: function() {
                yesterdayClose = Number(jsonData.yes);
                todayOpen = Number(jsonData.open);
                var points = this.points,
                    percent = 0,
                    str = '浠婂紑:' + todayOpen.toFixed(2) + space,
                    time = '鏃堕棿:' + Highcharts.dateFormat('%H:%M', this.points[0].x);

                // console.log(points);
                // str                
                Highcharts.each(points,
                    function(p, i) {
                        if (i === 0) {
                            str += '褰撳墠:' + p.y.toFixed(2);
                        } else if (i === 1) {
                            percent = (p.y - yesterdayClose) / yesterdayClose * 100;
                            str += '<span style="color: ' + (percent > 0 ? '#D71720' : '#00a650') + '">(' + percent.toFixed(2) + '%)</span>' + space;
                        }
                        // else if (i === 2) {
                        //     str += '鎴愪氦閲�(涓�):' + (p.y / 10000).toFixed(2) + space
                        // }
                    });

                str += time;

                $('#in_fs_infos').html(str);
            }
        },

        series: [{
                name: '寮€鐩樹环',
                data: timeLineData,
                tooltip: {
                    valueDecimals: 2
                },
                lineWidth: 0,
                states: {
                    hover: {
                        lineWidthPlus: 0,
                        lineWidth: 1
                    }
                }
            },
            {
                name: '娑ㄥ箙',
                data: timeLineData,
                yAxis: 1,
                zIndex: 10,
                lineWidth: 1,
                states: {
                    hover: {
                        lineWidthPlus: 0,
                        lineWidth: 1
                    }
                }

            },
            {
                name: '鎴愪氦閲�',
                data: caldatas[4],
                yAxis: 2,
                type: 'column'
            }
        ]
    });

}

//鏃堕棿鑼冨洿
function time_range(beginTime, endTime) {
    var strb = beginTime.split(":");
    if (strb.length != 2) {
        return false;
    }

    var stre = endTime.split(":");
    if (stre.length != 2) {
        return false;
    }

    var b = new Date();
    var e = new Date();
    var n = new Date();

    b.setHours(strb[0]);
    b.setMinutes(strb[1]);
    e.setHours(stre[0]);
    e.setMinutes(stre[1]);

    if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
        return true;
    } else {
        return false;
    }
}

//鏁版嵁璁＄畻
function cal_data(t, y) {
    var caldatas = [];
    var temp = null;
    var volume = [];
    var _volume = null;
    Highcharts.each(t,
        function(d, i) {
            if (i == 0) {
                ami = d[1];
                am = d[1];
                pmi = Number(100 * (d[1] / y - 1));
                pm = Number(100 * (d[1] / y - 1));

                //鎴愪氦閲�
                _volume = d[2];
            } else {
                ami = ami > d[1] ? d[1] : ami;
                am = am > d[1] ? am : d[1];
                pmi = pmi > Number(100 * (d[1] / y - 1)) ? Number(100 * (d[1] / y - 1)) : pmi;
                pm = pm > Number(100 * (d[1] / y - 1)) ? pm : Number(100 * (d[1] / y - 1));

                //鎴愪氦閲�
                var v = 0;
                for (j = i - 1; j > 0; j--) {
                    if (t[j][2] != 0) {
                        v = t[j][2];
                        break;
                    } else {
                        continue;
                    }
                }
                _volume = d[2] == 0 ? 0 : d[2] - v;
            }

            //鎴愪氦閲�
            temp = {
                x: d[0],
                y: _volume,
                // color: d[1] > todayOpen ? 'red' : 'green'
                color: '#2727ff'
            };

            volume.push(temp);
        });
    caldatas.push(ami);
    caldatas.push(am);
    caldatas.push(pmi);
    caldatas.push(pm);
    caldatas.push(volume);
    return caldatas;
}

//鏈€鏂扮殑鏄剧ず鍒癷nfo涓�
function show_info(t, y, o, id, type) {
    var length = t.length;
    if (type == 1) { //棣栭〉鍙婁釜鑲￠〉
        //鏈€鏂扮殑鏄剧ず鍒癷nfos涓婇潰
        var i = length - 1;
        //浠婂紑
        var str = '浠婂紑:' + o + space;
        //褰撳墠
        //娑ㄨ穼骞�
        if (y == 0) {
            str += '褰撳墠:' + t[i][1].toFixed(2) + '(0.00%)' + space;
        } else {
            str += '褰撳墠:' + t[i][1].toFixed(2);
            percent = (t[i][1] - y) / y * 100;
            str += '<span style="color: ' + (percent > 0 ? '#D71720' : '#00a650') + '">(' + percent.toFixed(2) + '%)</span>' + space;
        }
        //鏃堕棿
        str += '鏃堕棿:' + Highcharts.dateFormat('%H:%M', t[i][0]);
        //鎴愪氦閲�
        //str += '鎴愪氦閲�(涓�):' + (data[2] / 10000).toFixed(2) + space
    } else if (type == 2) { //鍙充晶杈规爮
        //鏈€鏂扮殑鏄剧ず鍒癷nfos涓婇潰
        var i = length - 1;
        //褰撳墠
        var str = '褰撳墠:' + t[i][1];
        //娑ㄨ穼骞�
        percent = (t[i][1] - y) / y * 100;
        str += '<span style="color: ' + (percent > 0 ? '#D71720' : '#00a650') + '">(' + percent.toFixed(2) + '%)</span>' + space;
        //鏃堕棿
        str += '鏃堕棿:' + Highcharts.dateFormat('%H:%M', t[i][0]);
    }
    $('#' + id).html(str);
}


//璁＄畻浣嶇疆
function cal_positions(t, y, c) {
    var positions = [];
    var tickMax = null;
    var tickMin = null;
    var increment = null;
    var interval = null;

    var ami = c[0];
    var am = c[1];
    tick = Number((ami));
    increment = Number(((am - ami) / 5));
    tickMin = Number((ami));
    tickMax = Number((am));
    if (0 == t.length) { //杩樻病鏈夋暟鎹椂锛寉 鐨勫箙鍊� 鍦� -1% - 1%涓婁笅娴姩
        tickMin = 0.99 * y;
        tickMax = 1.01 * y;
    } else if (0 == increment) { //鏈夋暟鎹簡  浣嗘槸鏁版嵁閮芥槸涓€鏍风殑骞呭€�
        if (y > Number(ami)) {
            tickMin = Number(ami);
            tickMax = 2 * y - Number(ami);
        } else if (y < Number(ami)) {
            tickMax = Number(am);
            tickMin = y - (Number(am) - y);
        } else {
            tickMin = 0.99 * y;
            tickMax = 1.01 * y;
        }
    } else if (ami - y < 0 && am - y >= 0) { //鏈€灏忓€煎湪鏄ㄦ棩鏀剁洏浠蜂笅闈紝鏈€澶у€煎湪鏄ㄦ棩鏀剁洏浠蜂笂闈�
        var limit = Math.max(Math.abs(ami - y), Math.abs(am - y));
        tickMin = y - limit;
        tickMax = y + limit;
    } else if (ami >= y && am > y) { //鏈€灏忔渶澶у€煎潎鍦ㄦ槰鏃ユ敹鐩樹环涓婇潰
        tickMax = am;
        tickMin = y - (tickMax - y);

    } else if (ami < y && am <= y) { //鏈€灏忔渶澶у€煎潎鍦ㄦ槰鏃ユ敹鐩樹环涓嬮潰
        tickMin = ami;
        tickMax = y + (y - tickMin);
    }
    if (tickMax > 2 * y) { //鏁版嵁瓒呰繃100%浜�
        tickMin = 0;
    }
    interval = Number(tickMax - y) / 10;
    tickMax += interval;
    tickMin = y - (tickMax - y);
    increment = (tickMax - y) / 2;
    tick = tickMin;
    var i = 0;
    for (tick; i++ < 6; tick += increment) {
        positions.push(Number(tick));
    }
    // 鍒ゆ柇鏄惁鏈夐噸澶嶇殑鍊�,鏈夐噸澶嶇殑鍊肩壒娈婂鐞�	
    for (var i = 0; i < 5; i++) {
        if (positions[i].toFixed(2) == positions[i + 1].toFixed(2)) {
            positions = [];
            for (i = y - 0.02; i < y + 0.04; i = i + 0.01) {
                positions.push(i);
            }
            return positions;
        }
    }

    return positions;
}

//涓偂鎴愭寚鍒嗘椂鍥�
function drawRightCzChart(el, jsonData, code) {

    //鏁版嵁
    var timeLineData = jsonData;
    //鏁版嵁闀垮害
    var length = timeLineData.length;
    //鏈€鍚庢暟鎹�
    var last_data = jsonData[length - 1];

    // x 杞存爣绛句究瀹滈珮搴�
    height = $('#' + el).height() * 0.23,
        width = $('#' + el).width();

    var volume = [];
    var _timeLineData = []
    Highcharts.each(timeLineData, function(d, i) {
        //缁勮鏁版嵁
        _timeLineData[d[0]] = [d[1], d[2], d[3], d[4], d[5]];
    });

    //椤堕儴淇℃伅鍒濆
    var str = ''
    str = '浠婃棩鎸囨暟:' + timeLineData[length - 1][1].toFixed(2) + '<span style="color: ' + (timeLineData[length - 1][3] > 0 ? '#D71720' : '#00a650') + '">(' + timeLineData[length - 1][3] + '%)</span>' + space;
    str += '鏃堕棿:' + Highcharts.dateFormat('%Y-%m-%d', timeLineData[length - 1][0]);
    //鎻愮ず妗嗗嚭鐜�
    $('#sr_cz_infos').html(str);
    $('#sr_cz_infos').show();

    // Create the chart
    $('#' + el).highcharts('StockChart', {
        chart: {
            spacing: 1,
            borderRadius: 0,
            animation: false
        },
        colors: ['#D71720', '#2E84CC', '#8bbc21', '#910000', '#1aadce',
            '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'
        ],
        rangeSelector: {
            enabled: false
        },
        scrollbar: {
            enabled: false,
        },
        navigator: {
            enabled: false,
            // top:190,
            // height:30,
            // outLineWidth:0
        },
        title: {
            text: ''
        },
        credits: {
            // enabled: false.
            text: 'Chinaipo.com',
            href: 'http://www.chinaipo.com',
            position: {
                align: 'left',
                x: 212,
                y: -26,
                style: {
                    cursor: 'pointer',
                    fontSize: '12px'
                }
            }
        },
        xAxis: [{
            tickLength: 0,
            gridLineWidth: 1,
            lineWidth: 0,
            labels: {
                align: 'left',
                y: -0,
                autoRotation: true,
                autoRotationLimit: 0,
                formatter: function() {
                    var date = Highcharts.dateFormat('%Y%m%d', this.value);
                    date = date.substr(2);
                    return date;
                }
            },
            showFirstLabel: true,
            showLastLabel: true,
            startOnTick: true
        }],
        yAxis: [{
            height: '93%',
            lineColor: '#C7CBD4',
            opposite: false,
            lineWidth: 1,
            labels: {
                x: 10,
                align: 'left'
            },
            showFirstLabel: true,
            showLastLabel: true
        }, {
            height: '93%',
            lineColor: '#C7CBD4',
            opposite: true,
            lineWidth: 1,
            labels: {
                x: 10,
                align: 'left'
            },
            showFirstLabel: true,
            showLastLabel: true
        }],
        plotOptions: {
            series: {
                dataGrouping: {
                    enabled: false
                },
                pointPlacement: 'on'
            }
        },

        tooltip: {
            shared: true,
            useHTML: true,
            shadow: false,
            formatter: function() {
                var points = this.points;
                var str = '';
                Highcharts.each(points,
                    function(p, i) {
                        str = '褰撴棩鎸囨暟:' + _timeLineData[p.x][0].toFixed(2) + '<span style="color: ' + (_timeLineData[p.x][2] > 0 ? '#D71720' : '#00a650') + '">(' + _timeLineData[p.x][2].toFixed(2) + '%)</span>' + space;
                        str += '鏃堕棿:' + Highcharts.dateFormat('%Y-%m-%d', p.x);
                    });

                $('#sr_cz_infos').html(str);
                return false;
            }
        },

        series: [{
            name: '寮€鐩樹环',
            data: timeLineData,
            tooltip: {
                valueDecimals: 2
            },
            lineWidth: 1,
            states: {
                hover: {
                    lineWidthPlus: 0,
                    lineWidth: 1
                }
            }
        }]
    });

}

//棣栭〉鎴愭寚鍒嗘椂鍥�
function drawIndexCzChart(el, jsonData, code) {

    //鏁版嵁
    var timeLineData = jsonData;
    //鏁版嵁闀垮害
    var length = timeLineData.length;
    //鏈€鍚庢暟鎹�
    var last_data = jsonData[length - 1];

    // x 杞存爣绛句究瀹滈珮搴�
    var height = $('#' + el).height() * 0.23,
        width = $('#' + el).width();

    var volume = [];
    var _timeLineData = []
    Highcharts.each(timeLineData, function(d, i) {
        //鎴愪氦閲�
        temp = {
            x: d[0],
            y: d[4],
            // color: d[1] > todayOpen ? 'red' : 'green'
            color: '#2727ff'
        };
        volume.push(temp);

        //缁勮鏁版嵁
        _timeLineData[d[0]] = [d[1], d[2], d[3], d[4], d[5]];
    });


    //y杞村埢搴�
    Highcharts.each(timeLineData,
        function(d, i) {
            if (i == 0) {
                ami = d[1];
                am = d[1];
            } else {
                ami = ami > d[1] ? d[1] : ami;
                am = am > d[1] ? am : d[1];
            }
        });

    var positions = [];
    var tickMax = null;
    var tickMin = null;

    tickMin = Math.floor(Number(ami / 250)) * 250;
    tickMax = Math.ceil(Number(ami / 250)) * 250;

    var tick = tickMin;
    var i = 0;
    for (tickMin; i++ < 6; tick += 250) {
        positions.push(Number(tick));
    }

    //椤堕儴淇℃伅鍒濆
    var str = ''
    str = '褰撴棩鎸囨暟:' + timeLineData[length - 1][1].toFixed(2) + '<span style="color: ' + (timeLineData[length - 1][3] > 0 ? '#D71720' : '#00a650') + '">(' + timeLineData[length - 1][3] + '%)</span>' + space;

    str += '鎴愪氦棰�:' + timeLineData[length - 1][5] / 10000 + '涓囧厓' + space;
    str += '鏃堕棿:' + Highcharts.dateFormat('%Y-%m-%d', timeLineData[length - 1][0]);

    //鎻愮ず妗嗗嚭鐜�
    $('#in_cz_infos').html(str);
    $('#in_cz_infos').show();

    // Create the chart
    $('#' + el).highcharts('StockChart', {
        chart: {
            spacing: 1,
            borderRadius: 0,
            animation: false
        },
        colors: ['#D71720', '#2E84CC', '#8bbc21', '#910000', '#1aadce',
            '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'
        ],
        rangeSelector: {
            height: 0,
            buttonTheme: {
                display: 'none' // 涓嶆樉绀烘寜閽�
            },
            inputEnabled: false, // 涓嶆樉绀烘棩鏈熻緭鍏ユ
            selected: 4
        },
        scrollbar: {
            enabled: false,
        },
        navigator: {
            top: 190,
            height: 30,
            xAxis: {
                labels: {
                    enabled: false
                }
            }
        },
        title: {
            text: ''
        },
        credits: {
            // enabled: false.
            text: 'Chinaipo.com',
            href: 'http://www.chinaipo.com',
            position: {
                align: 'left',
                x: 350,
                y: -height - 65,
                style: {
                    cursor: 'pointer',
                    fontSize: '12px'
                }
            }
        },
        xAxis: [{
            tickLength: 0,
            gridLineWidth: 1,
            top: 56,
            labels: {
                align: 'left',
                y: -113,
                autoRotation: false,
                autoRotationLimit: 0,
                formatter: function() {
                    return Highcharts.dateFormat('%Y%m%d', this.value);
                },
            },
            showFirstLabel: true
        }],
        yAxis: [{
                height: 170,
                lineColor: '#C7CBD4',
                opposite: false,
                lineWidth: 1,
                labels: {
                    x: 10,
                    align: 'left',
                    formatter: function() {
                        return this.value;
                    }
                },
                showFirstLabel: true,
                showLastLabel: true
            }, {
                height: 170,
                lineColor: '#C7CBD4',
                opposite: true,
                lineWidth: 1,
                labels: {
                    x: 10,
                    align: 'left',
                },
                showFirstLabel: true,
                showLastLabel: true
            },
            {
                top: 230,
                height: 70,
                lineColor: '#C7CBD4',
                opposite: false,
                lineWidth: 1,
                offset: 0,
                labels: {
                    x: 10,
                    align: 'left',
                    formatter: function() {
                        return this.value;
                    }
                },
                showFirstLabel: false,
                showLastLabel: false
            },
            {
                top: 230,
                height: 70,
                lineColor: '#C7CBD4',
                opposite: true,
                lineWidth: 1,
                offset: 0,
                labels: {
                    x: 10,
                    align: 'left',
                    formatter: function() {
                        return this.value;
                    }
                },
                showFirstLabel: false,
                showLastLabel: false
            }
        ],
        plotOptions: {
            series: {
                dataGrouping: {
                    enabled: false
                },
                pointPlacement: 'on'
            }
        },

        tooltip: {
            shared: true,
            useHTML: true,
            shadow: false,
            borderColor: "rgba(255, 255, 255, 0)",
            backgroundColor: "rgba(255, 255, 255, 0)",
            formatter: function() {
                var points = this.points;
                var str = '';
                Highcharts.each(points,
                    function(p, i) {
                        str = '褰撴棩鎸囨暟:' + _timeLineData[p.x][0].toFixed(2) + '<span style="color: ' + (_timeLineData[p.x][2] > 0 ? '#D71720' : '#00a650') + '">(' + _timeLineData[p.x][2].toFixed(2) + '%)</span>' + space;

                        str += '鎴愪氦棰�:' + _timeLineData[p.x][4] / 10000 + '涓囧厓' + space;
                        str += '鏃堕棿:' + Highcharts.dateFormat('%Y-%m-%d', p.x);
                    });

                $('#in_cz_infos').html(str);
            }
        },

        series: [{
                name: '寮€鐩樹环',
                data: timeLineData,
                tooltip: {
                    valueDecimals: 2
                },
                lineWidth: 1
            },
            {
                type: 'column',
                name: 'volume',
                data: volume,
                yAxis: 2
            }
        ]
    });

}